package com.boot.code.properties;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 代码生成器的公共配置
 * @date 2020/3/26 16:19
 **/

@Component
@ConfigurationProperties(prefix = "boot.code")
@Data
@NoArgsConstructor
@EqualsAndHashCode
public class CodeProperties {

    /**
     * @description 根目录
     * @date 2020/3/26 19:21
     **/
    private String rootPath;

    /**
     * @description 基础包目录
     * @date 2020/3/26 19:21
     **/
    private String packagePath;

    /**
     * @description 包目录的分隔符
     * @date 2020/3/26 19:21
     **/
    private String packageJoiner = ".";

    /**
     * @description 生成目标文件的后缀
     * @date 2020/3/26 19:21
     **/
    private String fileSuffix = ".java";

    private LayerProperties modelLayer = LayerProperties.builder().path("model").template("Model").build();

    private LayerProperties associationModelLayer = LayerProperties.builder().path("model").template("AssociationModel").build();

    private LayerProperties mapperLayer = LayerProperties.builder().path("mapper").suffix("Mapper").template("Mapper").build();

    private LayerProperties serviceLayer = LayerProperties.builder().path("service").suffix("Service").template("Service").build();

    private LayerProperties associationServiceLayer = LayerProperties.builder().path("service").suffix("Service").template("AssociationService").build();

    private LayerProperties serviceImplLayer = LayerProperties.builder().path("service.impl").suffix("ServiceImpl").template("ServiceImpl").build();

    private LayerProperties associationServiceImplLayer = LayerProperties.builder().path("service.impl").suffix("ServiceImpl").template("AssociationServiceImpl").build();

    private LayerProperties controlLayer = LayerProperties.builder().path("controller").suffix("Controller").template("Controller").build();

    private LayerProperties associationControlLayer = LayerProperties.builder().path("controller").suffix("Controller").template("AssociationController").build();

    private Map<String, ModuleProperties> modules;

}
